package com.xzy.c;

import com.xzy.service.StudentService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 说明：Bean生命周期之实例化前
 *
 * @author xzy
 * @date 2021/12/5 14:37
 */
public class Main {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();

        // 注册后置处理器、其他Bean
        applicationContext.register(MyInstantiationAwareBeanPostProcessor.class);
        applicationContext.register(StudentServiceImpl.class);
        applicationContext.refresh();

        System.out.println(applicationContext.getBean(StudentService.class));
    }
}
